#include "StdAfx.h"
#include "Integer.h"

using namespace Torrent::Bencode;

Integer::Integer(std::istream& stream)
{
    stream.get();
    stream >> _value;

    if (stream.fail() || stream.get() != 'e')
    {
        return; //throw...
    }

}

Integer::~Integer(void)
{
}

void Integer::print( std::ostream& stream, bool debug /*= false*/ )
{
    stream << "i" << _value << "e";
}